package com.bsoft.gol.hbs.message.sendMsg;

import ctd.spring.boot.annotation.SsdevService;
import ctd.util.AppContextHolder;
import ctd.util.annotation.RpcService;
import hcn.base.healthinfo.qo.ArticleInteractionRequest;
import hcn.common.MqConstant;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * @program: Myproject
 * @description: 异步发送短信
 * @author: zangsf
 * @create: 2023-02-16 15:31
 **/
@SsdevService("sendInteractionService")
public class SendInteractionServiceImpl{

    public static final Logger LOGGER = LoggerFactory.getLogger(SendInteractionServiceImpl.class);

    @RpcService
    public void  productionMessage (ArticleInteractionRequest articleInteractionRequest){
        sendInteraction(articleInteractionRequest);
    }



    private void sendInteraction(ArticleInteractionRequest articleInteractionRequest) {
        // topic + tag
        RocketMQTemplate rocketMQTemplate = AppContextHolder.get().getBean(RocketMQTemplate.class);
        rocketMQTemplate.convertAndSend(MqConstant.TOPIC_BIZ_SEND_INTERACTION + ":" + MqConstant.TOPIC_BIZ_SEND_INTERACTION, articleInteractionRequest);
    }
}